﻿Imports System.Text
Imports System.Reflection
Public Class Code

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.Close()
    End Sub

    Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click

        Try

            Dim cv As New CrystlViewer
            If String.IsNullOrEmpty(txtParentName.Tag) Then
                cv._ParamsValues.Add("TITLE", "所有编程语言数据一览")
                cv._ParamHashTable.Add("TITLE", "所有编程语言数据一览")
            Else
                cv._ParamsValues.Add("TITLE", "编程语言" + Me.txtParentName.Text + "数据一览")
                cv._ParamHashTable.Add("TITLE", "编程语言" + Me.txtParentName.Text + "数据一览")
            End If
            cv._Rt = CrystlViewer.ReportType.Code

            cv._ParamsValues.Add("txtParentName", Me.txtParentName.Tag.ToString())

            'Me.Opacity = 0
            'Me.Visible = False
            'Dim pf As New ProgessForm(cv)
            'pf.ShowDialog()
            Using cv
                cv.ShowDialog()
            End Using
            'Me.Close()

        Catch ex As Exception
            'SaveException(ex) 'D-2009-10-11
            UTIL.CException.SaveExcepiton(UTIL.ErrorType.Error, ex, MethodBase.GetCurrentMethod().GetType()) 'A-2009-10-11 
        End Try
    End Sub

    Private Sub Code_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
       
        Me.txtParentName.Tag = ""
    End Sub

    Private Sub MyButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyButton1.Click
        Dim ttf As Wys.Control.Vb.TreeTableFromBase = New Wys.Control.Vb.TreeTableFromBase(Me.txtParentName.Tag.ToString())
        ttf.ID = "ID"
        ttf.ParentID = "ParentID"
        ttf.DisplayName = "Name"
        ttf.TableName = "XscBugType"
        ttf.Text = "语言类型管理"
        ttf.TypeId = 2
        ttf.ExpandChild = False
        ttf.ShowDialog()
        If (Not ttf.Cancel) Then
            txtParentName.Text = ttf.DisplayNameValue
            txtParentName.Tag = ttf.Result
        End If
        txtParentName.Text = ct.GetParentName(txtParentName.Tag.ToString(), "XscBugType", "Name", "ParentID", "ID")
    End Sub


    Private Sub 页面设置ToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles 页面设置ToolStripMenuItem.Click
        Using frm As PageSetting = New PageSetting
            frm.ShowDialog()
            frm.Dispose()
        End Using
    End Sub
End Class
